let i = 0;

function foot() {
    i++;
    postMessage(i);//发送数据
    setTimeout(foot,1000);
}

foot();